package listen

import "ezcloud/gw/internal/conf"

type ListenerType string

const (
	TCP ListenerType = "tcp"
	UDP ListenerType = "udp"
)

type Listener interface {
	Start() error
	Stop() error
}

func NewListener(c conf.ListenerConfig) Listener {
	switch ListenerType(c.Type) {
	case TCP:
		return &TcpListener{config: c}
	default:
		return nil
	}
}
